import http from '@src/util/http';

let prefix = '/api/user';

/**
 * 是否显示人员卡片
 * @returns {*}
 */
 function isShowUserCard() {
  return http.get(`${prefix}/outside/tenant/isShowUserCard`)
}

/**
 * 获取人员卡片自定义配置
 * @returns {*}
 */
function getUserCardConfig() {
  return http.get(`${prefix}/outside/tenant/getUserCardConfig`)
}

/**
* 修改人员卡片开关
* @returns {*}
*/
function updateUserCardShow(flag:any) {
 return http.get(`${prefix}/outside/tenant/updateUserCardShow?showCard=${flag}`)
}

/**
* 修改人员卡片IM开关
* @returns {*}
*/
function updateUserCardShowIm(flag:any) {
  return http.get(`${prefix}/outside/tenant/updateUserCardIm?showIm=${flag}`)
 }
 
/**
 * 更新人员卡片配置
 * @returns {*}
 */
 function updateUserCardConfig(params:any) {
  return http.post(`${prefix}/outside/tenant/updateUserCardConfig`,params)
}

/**
 * 获取隐藏人员配置规则
 * @returns {*}
 */
 function getUserCardRuleList() {
  return http.get(`${prefix}/outside/tenant/getUserCardRuleList`)
}

/**
 * 新增隐藏人员卡片规则
 * @returns {*}
 */
 function createUserCardRule(params:any) {
  return http.post(`${prefix}/outside/tenant/createUserCardRule`,params)
}

/**
 * 更新隐藏人员卡片规则
 * @returns {*}
 */
 function updateUserCardRule(params:any) {
  return http.post(`${prefix}/outside/tenant/updateUserCardRule`,params)
}

/**
* 删除隐藏人员配置规则
* @returns {*}
*/
function deleteUserCardRule(id:String) {
 return http.get(`${prefix}/outside/tenant/deleteUserCardRule?id=${id}`)
}

/**
 * 更新隐藏人员卡片规则
 * @returns {*}
 */
 function updateUserCardFieldConfig(params:any) {
  return http.post(`${prefix}/outside/tenant/updateUserCardFieldConfig`,params)
}

/**
 * 查询系统水印设置
 * @returns {*}
 */
function getWatermarkConfig(params: any) {
  return http.get(`${prefix}/outside/tenant/getWatermarkConfig`,params)
}

/**
 * 更新系统水印设置
 * @returns {*}
 */
function updateWatermarkConfig(params: any) {
  return http.post(`${prefix}/outside/tenant/updateWatermarkConfig`,params)
}

/**
 * 获取水印信息
 * @returns {*}
 */
function getWatermark(params: any) {
  return http.get(`${prefix}/outside/tenant/getWatermark`,params)
}

/**
* 获取是否展示IM
* @returns {*}
*/
function getIsShowIm() {
  return http.get(`${prefix}/outside/tenant/isShowIm`)
 }
export {
  isShowUserCard,
  getUserCardConfig,
  updateUserCardConfig,
  getUserCardRuleList,
  createUserCardRule,
  updateUserCardRule,
  deleteUserCardRule,
  updateUserCardShow,
  updateUserCardShowIm,
  updateUserCardFieldConfig,
  getWatermarkConfig,
  updateWatermarkConfig,
  getWatermark,
  getIsShowIm
};